A new automatic test data generation algorithm based on PSO-ACO
نویسندگان
چکیده
In view of the shortcomings of the test data generation algorithm including particle swarm optimization algorithm and ant colony algorithm, a new algorithm is proposed, which is based on the combination of particle swarm algorithm and parameter adjustment. This algorithm can dynamically adjust its search capabilities based on the fitness value of particles , combine the advantages of particle swarm optimization (PSO) algorithm and ant colony algorithm(ACO)to ensure the convergence and accuracy of the algorithm. Experiments show that the new algorithm can effectively improve the efficiency of test data generation. Introduction Software testing is accompanied with the whole software development cycle, so it is one of the important means to control the cost of development and guarantee the quality of products. Test data can be generated automatically to shorten the test cycle, reduce testing costs. In the initial field of automatic test data generation method more often used include random method, symbolic execution method, program instrumentation method and iterative relaxation method .In view of the shortcomings of the test data generation algorithm, But they are poor in practical application in large projects, and the implementation efficiency is low [1]. Now there are a variety of heuristic search algorithms applied to automatic test data generation. The genetic algorithm, particle swarm optimization and ant colony algorithm are the most widely used among them. These three algorithms also have disadvantages. Scholars have done a lot of research on the disadvantages of these three algorithms: FU B successfully introduced the ant colony algorithm to the software test data automatic generation model [2]. Aiming at the problems of low convergence accuracy and easy to fall into local extreme, Dai Yuqian and Dong Yuehua proposed a hybrid particle swarm optimization algorithm HPSO [3]. Zhou Hong et al. Combine the genetic algorithm and particle swarm algorithm to form a new hybrid algorithm, and successfully applied to the automatic generation of software test data [1]. Yu Zhenyang put forward an automatic generation algorithm based on quantum particle swarm optimization (QPSO) test data in the software testing [4]. Shi Guiying and her partners proposed a new improved particle swarm optimization algorithm, effectively overcome the particle swarm algorithm prone to premature stagnation of the defect [5]. Lin Mu Gang presented a dynamic adjustment of parameters adaptive particle swarm optimization, to effectively regulate the global and local search ability of the algorithm and maintain the individuality of particles [6]. Shi and Eberhart proposed by decreasing linear inertia weight adjustment method to improve the learning ability of particles effectively. The local search ability of the algorithm and the global search ability are balanced by rationally adjusting the algorithm parameters [7]. 4th International Conference on Mechatronics, Materials, Chemistry and Computer Engineering (ICMMCCE 2015) © 2015. The authors Published by Atlantis Press 1159 In the above studies, we can see improvement strategies for these search algorithms can be divided into two categories: one is based on the idea of hybrid algorithm; the other is to adjust the algorithm parameters. In this article we overlay these two strategies, that is the introduction of the ant colony algorithm’s “pheromone mechanism [9]” in particle swarm algorithm and dynamically adjust parameters on this basis. We propose a new automatic test data generation algorithm base on the PSO and ACO Algorithm. This algorithm makes full use of the global search capability of PSO algorithm in the search early to get the pheromone, and then use the ant colony algorithm’s “pheromone mechanism” to search for an exact solution to the problem. While the particles of different fitness value particle swarm algorithm for the desired search ability of different problems, we have introduced the concept of particle relatively excellent in the new algorithm to dynamically adjust the inertia weight and learning factor. It is through the rational control algorithm convergence speed make the algorithm search results more accurate and effective. Experiments prove that the new algorithm can effectively avoid defects such as premature convergence and local extreme in the particle swarm optimization algorithm and the ant colony algorithm, which has better convergence performance. Text Particle Swarm Optimization(PSO). Particle swarm optimization (PSO) is a swarm intelligence evolutionary algorithm [8], which is proposed by Berhart and Dr. Kennedy in 1995. Assume that there is a particle group in the m-dimensional space. Its population total number of this particle group is n, then at time t, position of a particle i is denoted as xi= xi1,xi2,⋯,xim , its current speed is vi=(vi1,vi2,⋯,vim), while the current particle obtained in the search process history optimal solution as individual extreme pi =(pi1,pi2,⋯,pim), and the history optimal solution of particle group now found referred to as global extreme gi =(gi1,gi2,⋯,gim). Each particle updates respective positions and speed according to equation (1) and Equation (2) at time t + 1: vit 1 ωvit c1r1 pit‐xit c2r2 git‐xit (1) xi=xi+vi (2) Which i∈(1,2,⋯,n), ω is the inertia weight used to represent the influence of the particle velocity at time t to time t + 1; c1 and c2 are learning factors, which are used to adjust the direction of particle toward its best position and the step of particle flying to the global best position (c1,c2∈[0,2]); r1 and r2 are speed constraint factors when the particle is during the location update, which are two uniform distribution random numbers in [0, 1]. Ant colony algorithm (ACO). Ant colony algorithm (ACO) simulates the collective behavior of ant colony composed by a large number of ants. Suppose there are n ants, every ant on each path based on previous ant pheromones left to choose the way to go. τrs t represents the total amount of pheromones on the path from node r to node s at time t, and the initial amount of pheromones on each path is τrs 0 =C (C is a constant). The probability prs k of the ant k transfer from node r to node s expressed as follows:
منابع مشابه
Optimizing Cost Function in Imperialist Competitive Algorithm for Path Coverage Problem in Software Testing
Search-based optimization methods have been used for software engineering activities such as software testing. In the field of software testing, search-based test data generation refers to application of meta-heuristic optimization methods to generate test data that cover the code space of a program. Automatic test data generation that can cover all the paths of software is known as a major cha...
متن کاملA New Software Data-Flow Testing Approach via Ant Colony Algorithms
Search-based optimization techniques (e.g., hill climbing, simulated annealing, and genetic algorithms) have been applied to a wide variety of software engineering activities including cost estimation, next release problem, and test generation. Several search based test generation techniques have been developed. These techniques had focused on finding suites of test data to satisfy a number of ...
متن کاملA Hybrid Ant Colony Algorithm for Quadratic Assignment Problem
Quadratic assignment problem (QAP) is one of fundamental combinatorial optimization problems in many fields. Many real world applications such as backboard wiring, typewriter keyboard design and scheduling can be formulated as QAPs. Ant colony algorithm is a multi-agent system inspired by behaviors of real ant colonies to solve optimization problems. Ant colony optimization (ACO) is one of new ...
متن کاملPMU Placement Methods in Power Systems based on Evolutionary Algorithms and GPS Receiver
In this paper, optimal placement of Phasor Measurement Unit (PMU) using Global Positioning System (GPS) is discussed. Ant Colony Optimization (ACO), Simulated Annealing (SA), Particle Swarm Optimization (PSO) and Genetic Algorithm (GA) are used for this problem. Pheromone evaporation coefficient and the probability of moving from state x to state y by ant are introduced into the ACO. The modifi...
متن کاملA Hybrid PSO/ACO Algorithm for Discovering Classification Rules in Data Mining
We have previously proposed a hybrid particle swarm optimisation/ant colony optimisation (PSO/ACO) algorithm for the discovery of classification rules. Unlike a conventional PSO algorithm, this hybrid algorithm can directly cope with nominal attributes, without converting nominal values into binary numbers in a preprocessing phase. PSO/ACO2 also directly deals with both continuous and nominal a...
متن کامل